package com.deyuanyun.pic.settings.mapper.pipe;

import com.deyuanyun.pic.settings.controller.dto.PipeLineInfraVO;
import com.deyuanyun.pic.settings.controller.dto.PipeValidateVO;
import com.deyuanyun.pic.settings.domain.pipe.PipeLine;
import com.deyuanyun.pic.settings.domain.pipe.PipeLineExample;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface PipeLineMapper {

	int countByExample(PipeLineExample example);

	int deleteByExample(PipeLineExample example);

	int deleteByPrimaryKey(String id);

	int insert(PipeLine record);

	int insertSelective(PipeLine record);

	List<PipeLine> selectByExample(PipeLineExample example);

	PipeLine selectByPrimaryKey(String id);

	int updateByExampleSelective(@Param("record") PipeLine record, @Param("example") PipeLineExample example);

	int updateByExample(@Param("record") PipeLine record, @Param("example") PipeLineExample example);

	int updateByPrimaryKeySelective(PipeLine record);

	int updateByPrimaryKey(PipeLine record);

    
    List<PipeLine> selectAllPipeLine();

    List<PipeLine> getLine();

	/**
	 * 查询所有管道(条件查询)，含分页
	 * @param
	 * @return 
	 * @throws
	 * @author axiao(xj08.dream@gmail.com)
	 * @date 2016-09-02
	 */
	List<PipeLine> selectByCondition(PipeLineInfraVO pipeLineInfraVO);

	/**
	 * 验证管道的名字或者代号是否重复
	 * @param pipeValidateVO
	 * @return
	 * @author axiao(xj08.dream@gmail.com)
	 * @date 2016-11-25
	 */
	int validateRepByline(PipeValidateVO pipeValidateVO);
	
    /**
     * 根据管道id批量删除未发布的管道信息
     * @param ids 管道id数组
     * @return
     * @author axiao(xj08.dream@gmail.com)
     * @date 2016-09-02
     */
	int deleteLineByIds(@Param("ids") String[] ids);


    /**
     *  管道数据发布
     *  @author axiao(xj08.dream@gmail.com)
     *  @date 2016-09-02
     *  @version 1.0
     *  Histroy: [修改人][时间][描述]
     */
	int updateStatus(@Param("ids") String[] ids);

    /**
     * 管道启用、停用数据修改
     * @param ids
     * @param status 0为空为启用，1为停用
     * @return
     * @author axiao(xj08.dream@gmail.com)
     * @date 2016-09-02
     */
	int updateLineS(@Param("ids") String[] ids, @Param("status") String status);

	public PipeLine getLineByName(@Param("name") String name);
}